// 3375. 使数组的值全部为 K 的最少操作次数
// AC：https://leetcode.cn/problems/minimum-operations-to-make-array-values-equal-to-k/submissions/620498396/

class Solution {
public:
    int minOperations(vector<int>& nums, int k) {
        set<int> s={nums.begin(),nums.end()};
        auto it =s.begin();
        if(*it<k)
            return -1;
        if(*it==k)
            return s.size()-1;
        return s.size();
    }
};